// vue.config.js
const {defineConfig} = require('@vue/cli-service')
const resolve = (dir) => path.join(__dirname, dir)
module.exports = defineConfig({
	transpileDependencies: true,
	// webpack-dev-server 相关配置
	devServer: {
	    // open: true,
	    // host: '0.0.0.0',
	    port:8001,
	    // 端口号
	    https: false,
	    hotOnly: true,
	    disableHostCheck: true,
	    proxy: {
	        '/api': {
	            target: 'http://www.gold1203.top',
	            //接口域名
	            changeOrigin: true,
	            //是否跨域
	            secure: false,
	            //如果是https请求 需要设置为true
	            // logLevel: 'debug',
	            //ws: true,//是否要代理 websocket
	            pathRewrite: {
	                '^/api': ''
	            }
	        },
	    },
	},
	chainWebpack: config => {
	    config.resolve.alias
	        .set('@', resolve('src'))
	        .set('common', resolve('src/common'))
	        .set('utils', resolve('src/utils'))
	},
	pluginOptions: {
		electronBuilder: {
			nodeIntegration: true,
			builderOptions: {
				nsis: {
					allowToChangeInstallationDirectory: true, //自定义安装路径
					oneClick: false,
					shortcutName: '豫图网'
				},
				// win: {
					// publish: [{
					// 	provider: "generic",
					// 	url: "http://101.200.158.135/pc/" //更新包地址  
					// }],
				// },
				productName: 'ytw' //项目名
			}
		},
	}
})